import qs from 'qs'

export default $axios => ({
    getOrderList(type,id){
        return $axios.get('/server/order',{
            params:{
                type,
                id
            }
        })
    },
    updateOrder(shipAddress1,shipCity,shipState,shipZip,shipCountry,courier,shipToLastName,username,orderId,orderDate){
        return $axios.put('/server/order',qs.stringify({
            type:"order",
            shipAddress1,
            shipCity,
            shipState,
            shipZip,
            shipCountry,
            courier,
            shipToLastName,
            username,
            orderId,
            orderDate
        }))
    },
    updateOrderStatus(orderId,status){
        return $axios.put('/server/order',qs.stringify({
            type:"orderStatus",
            orderId,
            status
        }))
    },
})
